﻿///<reference path='jquery-1.4.4-vsdoc.js'/>
////显示系统时间
function changeTime() {
    var curdate = new Date().format("yyyy年MM月dd日  hh:mm:ss");
    $("#timemsg").html("<font style='font-weight:normal;color:#033B74;font-size:12'>当前时间：" + curdate + "</font>");
}
$(document).ready(function () {
    //日期时间格式
    Date.prototype.format = function (format) {
        var o = {
            "M+": this.getMonth() + 1, //month   
            "d+": this.getDate(),    //day   
            "h+": this.getHours(),   //hour   
            "m+": this.getMinutes(), //minute   
            "s+": this.getSeconds(), //second   
            "q+": Math.floor((this.getMonth() + 3) / 3), //quarter   
            "S": this.getMilliseconds() //millisecond   
        }
        if (/(y+)/.test(format)) format = format.replace(RegExp.$1,
            (this.getFullYear() + "").substr(4 - RegExp.$1.length));
        for (var k in o) if (new RegExp("(" + k + ")").test(format))
            format = format.replace(RegExp.$1,
                    RegExp.$1.length == 1 ? o[k] :
                    ("00" + o[k]).substr(("" + o[k]).length));
        return format;
    };
    setInterval(changeTime, 1000);
});
function addTab(title, href) {
    var tt = $('#main-center');
    if (tt.tabs('exists', title)) {
        tt.tabs('select', title);
    } else {
        if (href) {
            var content = '<iframe  scrolling="no" frameborder="0"  src="' + href + '" style="width:100%;height:100%;"></iframe>';
        } else {
            var content = '未实现';
        }
        tt.tabs('add', {
            title: title,
            closable: true,
            content: content
        });
    }
}     